//
//  GHMenuControl.m
//  GodHorses
//
//  Created by Mac on 2017/11/17.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "GHMenuControl.h"

@implementation GHMenuControl

- (instancetype)initWithFrame:(CGRect)frame value:(NSString *)value name:(NSString *)name showLine:(BOOL)showLine{
    if (self == [super initWithFrame:frame]) {
        
        self.valueLable = [[STLabel alloc] initWithFrame:CGRectMake(0, 20, self.st_width, 19)
                                                     text:[NSString stringWithFormat:@"%@",value]
                                                textColor:GH_YellowBackGroundColor
                                                     font:18
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentCenter];
        self.valueLable.st_centerX = self.st_width / 2;;
        [self addSubview:self.valueLable];
        self.nameLable = [[STLabel alloc] initWithFrame:CGRectMake(0, self.valueLable.st_bottom + 10,self.st_width, 13)
                                                          text:name
                                                     textColor:GH_firstTextColor
                                                          font:12
                                                   isSizetoFit:NO
                                                 textAlignment:NSTextAlignmentCenter];
        self.nameLable.st_centerX = self.st_width / 2;;
        [self addSubview:self.nameLable];
        self.lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 0.6 * self.st_height)];
        self.lineView.backgroundColor = GH_lineColor;
        self.lineView.st_centerY = self.st_height /2;
        self.lineView.st_right = self.st_width - 1;
         [self addSubview:self.lineView];
        self.lineView.hidden = !showLine;
        self.clipsToBounds = YES;
 
    }
    return self;
}

@end
